package com.zhouqinuan.spring.cloud.develop.framework.demo.provider.feign;

import javax.validation.Valid;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.zhouqinuan.spring.cloud.develop.framework.demo.provider.feign.fallback.UserFeignFallBack;
import com.zhouqinuan.spring.cloud.develop.framework.demo.provider.feign.vo.req.GetUserInfoByIdReq;
import com.zhouqinuan.spring.cloud.develop.framework.demo.provider.feign.vo.resp.GetUserInfoByIdResp;

//指定这是feign客户端 name属性指明要调用的服务名
@FeignClient(name = "${feign.demo-provider}", fallback = UserFeignFallBack.class)
public interface UserFeign {

    @PostMapping("/user/getUserInfoById")
    GetUserInfoByIdResp getUserInfoById(@RequestBody @Valid GetUserInfoByIdReq reqVO) throws Exception;
}
